<%@ LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
'///////////////////////////////////////////////////////////////////////////////
'// 插件应用:    Z-Blog 1.8 Arwen
'// 插件制作:    haphic(http://haphic.esloy.com)
'// 备    注:    Couple 参数设定
'// 最后修改：   2009-12-29
'// 最后版本:    0.4
'///////////////////////////////////////////////////////////////////////////////
%>
<% Option Explicit %>
<% On Error Resume Next %>
<% Response.Charset="UTF-8" %>
<% Response.Buffer=True %>
<!-- #include file="../../../c_option.asp" -->
<!-- #include file="../../../function/c_function.asp" -->
<!-- #include file="../../../function/c_function_md5.asp" -->
<!-- #include file="../../../function/c_system_lib.asp" -->
<!-- #include file="../../../function/c_system_base.asp" -->
<!-- #include file="../../../function/c_system_plugin.asp" -->
<!-- #include file="../../../function/c_system_event.asp" -->
<!-- #include file="../../../plugin/p_config.asp" -->
<%
Call System_Initialize()

'检查非法链接
Call CheckReference("")

'检查权限
If BlogUser.Level>1 Then Call ShowError(6) 

'检查是否启用
If Not LCase(ZC_BLOG_THEME)=LCase("Couple") Then Call ShowError(48) 

BlogTitle="Couple"


%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<%=ZC_BLOG_LANGUAGE%>" lang="<%=ZC_BLOG_LANGUAGE%>">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="Content-Language" content="<%=ZC_BLOG_LANGUAGE%>" />
	<link rel="stylesheet" rev="stylesheet" href="../../../CSS/admin.css" type="text/css" media="screen" />
	<script language="JavaScript" src="../../../script/common.js" type="text/javascript"></script>
	<title><%=BlogTitle%></title>
	<style>
		strong{font-weight:normal;color:navy;}
		#updateRESULT {position:absolute;width:100%;height:100%;top:0;background-color:gray;}
		#updateRESULT div {position:relative;width:400px;margin:100px auto;padding:10px 20px;background-color:white;border:3px double gray;}
	</style>
	<script type="text/javascript">var str00="<%=ZC_BLOG_HOST%>";var strThemeName="<%=ZC_BLOG_THEME%>";var sLoading="正在等待服务器数据, 请稍候...";</script>
	<script type="text/javascript" src="<%=ZC_BLOG_HOST%>themes/<%=ZC_BLOG_THEME%>/plugin/register/Register.js"></script>
	<script type="text/javascript">$(document).ready(function(){setMark();});</script>
</head>
<body>
			<div id="divMain">
<div class="Header">Couple - 参数设定</div>
<div id="divMain2">
<div id="ShowBlogHint"><%Call GetBlogHint()%></div>
<form  id="verifyHint" border="1" name="content1" style="border:1px solid #91ADBF;margin:4px 0 4px 0;padding:5px;" method="get">
<%
	Dim strDomain
	strDomain = Request.ServerVariables("SERVER_NAME")
	'strDomain = Request.ServerVariables("HTTP_HOST")

	Dim tmpVerifyCode
	tmpVerifyCode = LoadFromFile(BlogPath & "/THEMES/"& ZC_BLOG_THEME &"/PLUGIN/REGISTER/VerifyNumber"&ZC_BLOG_CLSID&".html","utf-8")

	Response.Write "<p>※ "
	If Not MD5(strDomain & Couple_VerifyCode) = tmpVerifyCode Then
		Response.Write "您的主题未获授权 <a href=""javascript:void(0)"" onclick=""regManual('ping')"">[验证授权]</a>"
	Else
		Response.Write "此主题授权给:<b>"& strDomain &"</b>, 验证码:<b>"& Couple_VerifyCode &"</b> <a href=""javascript:regAlert('fmode')"" onclick=""return window.confirm('重新验证授权将删除已保存的授权信息, 是否继续?')"">[重新验证授权]</a>"
	End If
	Response.Write " <a href=""javascript:void(0)"" onclick=""regManual('update')"">[检查新版]</a></p>"
%>
</form>
<form id="edit" name="edit" method="post">
<%

	Dim tmpSng

	tmpSng=LoadFromFile(BlogPath & "/THEMES/"& ZC_BLOG_THEME &"/PLUGIN/config.asp","utf-8")

	Response.Write "<hr/>"

	Response.Write "<p><b>1. 主题参数定义</b></p>"

	Response.Write "<p>※ 用户选择: "

	Dim User
	Dim strZC_Couple_UserLeft
	If LoadValueForSetting(tmpSng,True,"Numeric","Couple_MaleID",strZC_Couple_UserLeft) Then
		Response.Write "左侧 <select class=""edit"" size=""1"" id=""userLeft"" name=""userLeft"" style=""width:90px;""><option value=""-1"">"&ZC_MSG157&"</option> "
		For Each User in Users
			If IsObject(User) Then
					Response.Write "<option value="""&User.ID&""" "
					If User.ID=CInt(strZC_Couple_UserLeft) Then Response.Write "selected=""selected"" "
					Response.Write ">"&TransferHTML(User.Name,"[html-format]")&"</option>"
			End If
		Next
		Response.Write "</select> "
	End If

	Dim strZC_Couple_UserRight
	If LoadValueForSetting(tmpSng,True,"Numeric","Couple_FemaleID",strZC_Couple_UserRight) Then
		Response.Write "右侧 <select class=""edit"" size=""1"" id=""userRight"" name=""userRight"" style=""width:90px;"" ><option value=""-1"">"&ZC_MSG157&"</option> "
		For Each User in Users
			If IsObject(User) Then
					Response.Write "<option value="""&User.ID&""" "
					If User.ID=CInt(strZC_Couple_UserRight) Then Response.Write "selected=""selected"" "
					Response.Write ">"&TransferHTML(User.Name,"[html-format]")&"</option>"
			End If
		Next
		Response.Write "</select> "
	End if

	Response.Write "</p>"


	Response.Write "<p>※ 清除 Ajax 日历功能所建立的缓存. <a href=""savesetting.asp?act=Clear"">[点此清除缓存]</a></p>"

	Dim strZC_Couple_HotPostDays
	If LoadValueForSetting(tmpSng,True,"Numeric","Couple_HotPostDays",strZC_Couple_HotPostDays) Then
		strZC_Couple_HotPostDays=TransferHTML(strZC_Couple_HotPostDays,"[html-format]")
		Response.Write "<p>※ 热门文章统计天数: <input name=""strZC_Couple_HotPostDays"" style=""width:28px"" type=""text"" value=""" & strZC_Couple_HotPostDays & """ /> 天以内, "
	End If

	Dim strZC_Couple_RandomDays
	If LoadValueForSetting(tmpSng,True,"Numeric","Couple_RandomDays",strZC_Couple_RandomDays) Then
		strZC_Couple_RandomDays=TransferHTML(strZC_Couple_RandomDays,"[html-format]")
		Response.Write "随机文章统计天数: <input name=""strZC_Couple_RandomDays"" style=""width:28px"" type=""text"" value=""" & strZC_Couple_RandomDays & """ /> 天以内.</p>"
	End If

	Dim strZC_Couple_HotPostOrder
	If LoadValueForSetting(tmpSng,True,"String","Couple_HotPostOrder",strZC_Couple_HotPostOrder) Then
		strZC_Couple_HotPostOrder=TransferHTML(strZC_Couple_HotPostOrder,"[html-format]")
		Response.Write "<p>※ 热门文章算法 <select name=""strZC_Couple_HotPostOrder"">"

		Response.Write "<option value=""A"" "
		If (strZC_Couple_HotPostOrder="A") Then Response.Write "selected=""selected"" "
		Response.Write ">先评论后浏览数. 适用于文章较少的博客 - 列表与最新文章差异较大.</option>"

		Response.Write "<option value=""B"" "
		If (strZC_Couple_HotPostOrder="B") Then Response.Write "selected=""selected"" "
		Response.Write ">评论引用数和浏览数的累加. 适用于文章较少的博客 - 列表与最新文章差异较大.</option>"

		Response.Write "<option value=""C"" "
		If (strZC_Couple_HotPostOrder="C") Then Response.Write "selected=""selected"" "
		Response.Write ">消除时间积累效果对热门程度的影响. 适用于在全部文章中提取热门.(巴士算法)</option></select></p>"
	End If

	Dim strZC_Couple_AutoBuildInterval
	If LoadValueForSetting(tmpSng,True,"Numeric","Couple_AutoBuildInterval",strZC_Couple_AutoBuildInterval) Then
		strZC_Couple_AutoBuildInterval=TransferHTML(strZC_Couple_AutoBuildInterval,"[html-format]")
		Response.Write "<p>※ 随机文章列表每隔 <input name=""strZC_Couple_AutoBuildInterval"" style=""width:28px"" type=""text"" value=""" & strZC_Couple_AutoBuildInterval & """ /> 分钟重建一次. 上次重建在 "& DateDiff("n",LoadFromFile(BlogPath & "/THEMES/"& ZC_BLOG_THEME &"/PLUGIN/CACHE/index.html","utf-8"),Now()) &" 分钟以前.</p>"
	End If

	Dim strZC_Couple_TagsCount
	If LoadValueForSetting(tmpSng,True,"Numeric","Couple_TagsCount",strZC_Couple_TagsCount) Then
		strZC_Couple_TagsCount=TransferHTML(strZC_Couple_TagsCount,"[html-format]")
		Response.Write "<p>※ 首页显示 Tags 个数: <input name=""strZC_Couple_TagsCount"" style=""width:28px"" type=""text"" value=""" & strZC_Couple_TagsCount & """ /> 个, "
	End If

	Dim strZC_Couple_TagsOrder
	If LoadValueForSetting(tmpSng,True,"String","Couple_TagsOrder",strZC_Couple_TagsOrder) Then
		strZC_Couple_TagsOrder=TransferHTML(strZC_Couple_TagsOrder,"[html-format]")
		Response.Write "按 "

		Response.Write "[<input name=""strZC_Couple_TagsOrder"" type=""Radio"" value=""Name"" "
		If (strZC_Couple_TagsOrder="Name") Then Response.Write "checked=""checked"" "
		Response.Write "/> 名称] "

		Response.Write "[<input name=""strZC_Couple_TagsOrder"" type=""Radio"" value=""ID"" "
		If (strZC_Couple_TagsOrder="ID") Then Response.Write "checked=""checked"" "
		Response.Write "/> 建立时间] "

		Response.Write "[<input name=""strZC_Couple_TagsOrder"" type=""Radio"" value=""Count"" "
		If (strZC_Couple_TagsOrder="Count") Then Response.Write "checked=""checked"" "
		Response.Write "/> 使用次数] 排列</p>"
	End If

	Dim strZC_Couple_TagsFilter
	If LoadValueForSetting(tmpSng,True,"Numeric","Couple_TagsFilter",strZC_Couple_TagsFilter) Then
		strZC_Couple_TagsFilter=TransferHTML(strZC_Couple_TagsFilter,"[html-format]")
		Response.Write "<p>※ 首页只显示使用次数大于等于 <input name=""strZC_Couple_TagsFilter"" style=""width:28px"" type=""text"" value=""" & strZC_Couple_TagsFilter & """ /> 的 Tags. </p>"
	End If

	Dim strZC_Couple_RegHost
	If LoadValueForSetting(tmpSng,True,"String","Couple_RegHost",strZC_Couple_RegHost) Then
		strZC_Couple_RegHost=TransferHTML(strZC_Couple_RegHost,"[html-format]")
		Response.Write "<p>※ 主题验证地址: <input name=""strZC_Couple_RegHost"" style=""width:260px"" type=""text"" value=""" & strZC_Couple_RegHost & """ /> 请确保正确填写,否则无法验证. </p>"
	End If

	Response.Write "<p><input type=""submit"" class=""button"" value=""提交设置"" id=""btnPost"" onclick='document.getElementById(""edit"").action=""SaveSetting.asp?act=Config"";return verifyPost();' /> "
	Response.Write "<input type=""reset"" class=""button"" value=""重设"" id=""btnPost2"" /> "
	Response.Write "<input onclick=""history.back(1);"" type=""button"" class=""button"" value=""返回""/></p>"

	Response.Write "<hr/>"

%>
</form>

<form border="1" name="content1" style="border:1px solid #91ADBF;margin:4px 0 4px 0;padding:5px;" method="get">
<hr/>
<p><b>2. 自定内容</b></p>
<!--type: 单行(sl)或多行(ml)  bd:需重建(t)或不需重建(f)-->
<p>※ About Us (关于博主) <a href="Edit.asp?type=ml&amp;bd=f&amp;file=<%=Server.URLEncode("AboutUs.asp")%>">[编辑]</a></p>
<p>※ RSS 订阅地址, 当前为 <strong>"<%=LoadFromFile(BlogPath & "/THEMES/"& ZC_BLOG_THEME &"/INCLUDE/RssUrl.asp","utf-8")%>"</strong> <a href="Edit.asp?type=sl&amp;bd=f&amp;file=<%=Server.URLEncode("RssUrl.asp")%>">[编辑]</a></p>
<hr/>
</form>

<form border="1" name="language" style="border:1px solid #91ADBF;margin:4px 0 4px 0;padding:5px;" method="get">
<hr/>
<p><b>3. 修改主题语言包</b></p>
<p>※ 您可以通过修改语言包切换主题前台语言, 或自定义主题前台显示的文字.</p>
<p style="color:darkred;">※ 注意: 由于主题的升级可能包含对语言包的修改, 升级过程将导致语言包被新文件覆盖.</p>
<p>※ <a href="Edit.asp?act=lang">[点此编辑主题语言包]</a> (需文件重建才能生效)</p>
<hr/>
</form>
<hr/>
<p style="color:navy;">※ 注: 加 "*" 者表示对该项目的编辑须重建才能生效!</p>
</div>
</div>

<script language="JavaScript" type="text/javascript">

function verifyPost(){

	var userLeftId=document.getElementById("userLeft").value;
	var userRightId=document.getElementById("userRight").value;
	if (userLeftId==-1 || userRightId==-1){
		alert('请为主题选择作者!');
		return false;
	}
	if (userLeftId==userRightId){
		alert('主题两侧的作者不能相同!');
		return false;
	}

	return true;

}


$(document).ready(function(){ 

try{
	//取消提示显示
	setTimeout(function(){
		var $objSysHint=$('#ShowBlogHint');
		//判断 Hint 是否为空只是为了 IE6...
		if ($objSysHint.html().length > 0){
			$('#ShowBlogHint').slideToggle('slow');
		}
	},3500);
	//setTimeout("document.getElementById('ShowBlogHint').style.display='none'",2000);
	}
catch(e){};

});

</script>

</body>
</html>
<%
Call System_Terminate()

If Err.Number<>0 then
  Call ShowError(0)
End If
%>

